﻿
using Bootstrap5.Abstractions;

using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Rendering;
using Microsoft.AspNetCore.Components.Routing;

namespace Bootstrap5;

/// <summary>
/// Represents a link compoent in <see cref="NavItem"/> as <c>&lt;a></c> element.
/// </summary>
[CssClass("nav-link")]
public class NavRouteLink : BootstrapChildContentComponentBase
{
    [Parameter] public NavLinkMatch Match { get; set; }
    [Parameter] [CssClass("disabled")] public bool Disabled { get; set; }
    [Parameter] [CssClass("active")] public bool Actived { get; set; }
    protected override void BuildRenderTree(RenderTreeBuilder builder)
    {
        builder.OpenComponent<NavLink>(0);
        BuildCommonAttributes(builder);
        builder.AddAttribute(15, nameof(NavLink.ChildContent), ChildContent);
        builder.CloseComponent();
    }
}
